package com.example.rbac.entity;



import com.example.rbac.entity.defefult.DateDefult;
import com.google.gson.annotations.Expose;
import lombok.Data;
import lombok.ToString;
import org.apache.shiro.authc.RememberMeAuthenticationToken;

import java.io.Serializable;

/**
 * Created by Administrator on 2017/8/22.
 */


@Data
@ToString(callSuper = true)
public class User extends DateDefult implements RememberMeAuthenticationToken{

    private String username;
    private String password;
    private String phone;
    private Character sex;
    private String email;
    private String token;
    private String adree;
    private boolean rememberMe = false;
    private String principal;
    private String credentials;

    /**
     * shiro用户验证
     * @return
     */
    @Override
    public boolean isRememberMe() {
        return rememberMe;
    }

    public void setRememberMe(boolean rememberMe) {
        this.rememberMe = rememberMe;
    }
    @Override
    public Object getPrincipal() {
        return getUsername();
    }

    @Override
    public Object getCredentials() {
        return getPassword();
    }
}
